home *** CD-ROM | disk | FTP | other *** search
/ Total Web Page (Professional Suite) / Total Web Page 99.iso / CGI / DOWNLOAD.CGI-S=SEARCH&C=TXT&F=README < prev    next >
Text File  |  1996-06-03  |  8KB  |  153 lines

  1. ##############################################################################
  2. # Simple Search                 Version 1.0                                  #
  3. # Copyright 1996 Matt Wright    mattw@worldwidemart.com                      #
  4. # Created 12/16/95              Last Modified 12/16/95                       #
  5. # Scripts Archive at:           http://www.worldwidemart.com/scripts/        #
  6. ##############################################################################
  7. # If you run into any problems while trying to configure this scripts, help  #
  8. # is available.  The steps you should take to get the fastest results, are:  #
  9. #       1) Read this file thoroughly                         #
  10. #       2) Consult the Matt's Script Archive Frequently Asked Questions:     #
  11. #               http://www.worldwidemart.com/scripts/faq/                 #
  12. #       3) If you are still having difficulty installing this script, send   #
  13. #          e-mail to: scripts-help@tahoenet.com                     #
  14. #          Include any error messages you are receiving and as much detail   #
  15. #          as you can so we can spot your problem.  Also include the variable#
  16. #          configuration block that is located at the top of the script.     #
  17. #                                         #
  18. # Hopefully we will be able to help you solve your problems.  Thank you.     #
  19. ##############################################################################
  20. # COPYRIGHT NOTICE                                                           #
  21. # Copyright 1996 Matthew M. Wright  All Rights Reserved.                     #
  22. #                                                                            #
  23. # Simple Search may be used and modified free of charge by anyone so long as #
  24. # this copyright notice and the comments above remain intact.  By using this #
  25. # code you agree to indemnify Matthew M. Wright from any liability that      #  
  26. # might arise from it's use.                                                 #  
  27. #                                                                            #
  28. # Selling the code for this program without prior written consent is         #
  29. # expressly forbidden.  In other words, please ask first before you try and  #
  30. # make money off of my program.                                              #
  31. #                                                                            #
  32. # Obtain permission before redistributing this software over the Internet or #
  33. # in any other medium.  In all cases copyright and header must remain intact.#
  34. ##############################################################################
  35.  
  36.     The simple search script was written to allow people to set up a 
  37. search of their site, so their users could enter keywords and find all 
  38. documents matching those keywords.  It was written to be simple, so there 
  39. are not many options.  When the search returns pages, it returns them in 
  40. no real order, and they are referenced with the <title> tag of that page.
  41.  
  42.     The instructions below explain how to set up and configure the 
  43. Simple Search script.  The script should have come with three files:
  44.  
  45.     1) README     - Useful installation instructions.
  46.     2) search.pl     - The Perl script which does the searching.
  47.     3) search.html  - A sample HTML Search Page.
  48.  
  49. SEARCH.PL
  50. =========
  51.  
  52.     This script is the one that you will need to define what files 
  53. you want to be searched and the locations of those files.  First you need 
  54. to define the variables:
  55.  
  56.     $basedir = '';
  57.         This is the base directory to the files you will want to 
  58.        search.  If you have all of your files in /home/joe/public_html
  59.        and you want to search files that are in 
  60.        /home/joe/public_html/work and /home/joe/public_html/fun, then
  61.        you would set your base directory at /home/joe/public_html/ and
  62.        then put subdirectories into the @files array, since they will be 
  63.        put together at run time.  The $basedir variable just saves you the 
  64.        time of having to type out the basedir over and over again for 
  65.        every file you want to include.
  66.  
  67.     $baseurl = '';
  68.         This is very similar to the basedir variable except that 
  69.        it will be used as a base reference to the files you want to search
  70.        in terms of the web.  For the example above with user joe, his 
  71.        baseurl would probably be something like: http://joe.host.com/~joe/ 
  72.        so that when the searched files are appended to this baseurl, they 
  73.        form a complete url to his files to place in the results.
  74.  
  75.     @files = ();
  76.         This is an array that includes all of the files you want 
  77.        to search.  The directory paths and filenames should be in 
  78.        reference to $basedir.  Wild cards are allowed in this array, so if 
  79.        joe wanted to search all html files in fun/ and work/, he would set 
  80.        his @files array up as: @files = ('fun/*.html','work/*.html');  You 
  81.        can also search whole directories at one time, like: @files = 
  82.        ('fun/','work/');  This would search all text files located in these 
  83.        directories.  Putting exact filenames will search only that filename.
  84.  
  85.     $title = "";
  86.         This variable is used to display the title of your page 
  87.        in the search results and used to link back to your main page.
  88.  
  89.     $title_url = '';
  90.         This is the url that would link to the page $title.
  91.  
  92.     $search_url = '';
  93.         This is the url to the search.html page you set up, so 
  94.        that it can be referenced from in the results page if users want
  95.        to make another search.
  96.  
  97.     That is all of the variables that need to be configured in your 
  98. script.  You must also chmod this script to 755 so that all users can 
  99. execute it and place it in your cgi-bin or change the name to 
  100. search.cgi.  Now you simply have to edit the search.html page and you are 
  101. ready to go!
  102. ------------------------------------------------------------------------------
  103.  
  104. SEARCH.HTML
  105. ===========
  106.  
  107.     This page needs only a little changing.  You will probably want 
  108. to change the title and header of this page to match your site, and you 
  109. may want to change the background and other features of it to make it fit 
  110. into your site better.
  111.  
  112.     The main thing you will need to change is the action="" of your 
  113. script from the fake url, to the url of your search.pl script.  Once you 
  114. have changed this, and have implemented the changes listed above in 
  115. search.pl, the search program should work.
  116.  
  117.     search.html should be chmoded 744 so that it is readable by everyone.
  118. ------------------------------------------------------------------------------
  119.  
  120. README
  121. ======
  122.  
  123.     Just read it!
  124. ------------------------------------------------------------------------------
  125.  
  126. HISTORY
  127. =======
  128.  
  129. Version 1.0    -    12/16/95    - First Version Released.
  130.  
  131. ------------------------------------------------------------------------------
  132.  
  133.     If you have any questions about setting up or implementing this 
  134. script feel free to mail me at the address at the top of this file AFTER 
  135. you have read the Frequently Asked Questions located at:
  136.  
  137.     http://www.worldwidemart.com/scripts/faq/
  138.  
  139. ------------------------------------------------------------------------------
  140.  
  141. Feel free to change/hack/modify whatever this script, but please leave 
  142. my name and url in it at all times.  If you end up implementing this 
  143. script on a page, please let me know by filling out the form located at:
  144.  
  145.     http://www.worldwidemart.com/scripts/implement.html
  146.  
  147. Feel free to link back to my site at the bottom of your page if you enjoy 
  148. these scripts and use them, although it is not required.  And most of all 
  149. Have fun!
  150.  
  151. ------------------------------------------------------------------------------
  152. Matt Wright - mattw@worldwidemart.com - http://www.worldwidemart.com/scripts/
  153.